package com.lagou.study.seckill.service;

import com.lagou.study.seckill.mapper.OrderMapper;
import com.lagou.study.seckill.pojo.Order;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

@Service
public class OrderService {

    @Autowired
    private OrderMapper orderMapper;

    public Order findById(String id){
        Optional<Order> result = orderMapper.findById(id);
        Order order = result.get();
        return order;
    }

    public void deleteById(String id){
        orderMapper.deleteById(id);
    }
}
